package common;

/**
 *
 *@Class Name: StringCreator
 *@author: wxu on Jul 31, 2014
 *
 */
public class DataPrinter {
	
	public static String printArray(boolean[] arr){
		StringBuilder out = new StringBuilder();
		out.append("[");
		for(int i = 0;i< arr.length;i++){
			out.append(arr[i]?"T":"F" + ",");
		}
		
		out.deleteCharAt(out.length()-1);
		out.append("]");
		
		return out.toString();
	}
	
	public static String printArray(String[] arr){
		return printArray(arr, true);
	}
	
	public static String printArray(String[] arr, boolean singleLine){
		StringBuilder out = new StringBuilder();
		out.append("[").append(singleLine?"":"\n");
		for(int i = 0;i< arr.length;i++){
			out.append(arr[i] + ",").append(singleLine?"":"\n");
		}
		
		out.deleteCharAt(out.length()-1);
		out.append("]");
		
		return out.toString();
	}

	public static String printArray(int[] arr){
		StringBuilder out = new StringBuilder();
		out.append("[");
		for(int i = 0;i< arr.length;i++){
			out.append(arr[i] + ",");
		}
		
		out.deleteCharAt(out.length()-1);
		out.append("]");
		
		return out.toString();
	}
}
